﻿using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Linq;
using System.Text;

namespace CipherLib
{
    internal class AppCommon
    {
        internal const string EX_ENVELOPE_CMS_EMPTY = "encodedEnvelopedCms is null or empty.";
        internal const string EX_ENVELOPE_CMS_INIT = "envelopedCms could not be initialized";
        internal const string EX_ENVELOPE_CMS_RECIPIENTINFO_NULL = "envelopedCms erroneous (RecipientInfos is null)";
        internal const string EX_ENVELOPE_CMS_RECIPIENTINFO_ERROR = "envelopedCms erroneous (RecipientInfos does not contain RecipientInfos)";
        internal const string EX_ENVELOPE_CMS_ERROR = "envelopedCms does not contain content after the decryption.";
        internal const string EX_ENVELOPE_CMS_RECIPIENT_ERROR = "recipient could not be initialized";

        //http://www.rsa.com/products/bsafe/documentation/sslc251html/group__AD__COMMON__OIDS.html
        internal const string CONT_OID = "1.2.840.113549.1.7.1";
        internal const string CONT_FRIENDLY_NAME = "PKCS 7 Data";
        internal const string ALGO_OID = "1.2.840.113549.3.2";
        internal const string ALGO_FRIENDLY_NAME = "rc2";

        internal const string X509_SUBJECTNAME = "subjectName";
        internal const string EX_X509_CERTIFICATE_NOT_FOUND = "No certificate for the subject: {0} in storeName: {1} and storeLocation: {2} found";

        internal const string EX_XML_CONTENT = "Content";
        internal const string EX_XML_ELEMENT_NOTFOUND = "The specified element was not found.";
        internal const string EX_XML_DOCUMENT_NOTDEFINED = "No XmlDocument defined.";
        internal const string EX_XML_SIGNATURE = "Signature";
        internal const string EX_XML_SIGNATURE_NOTFOUND = "No signature found.";

        internal const string CIPHERLIB_SMIME_CODE = "[REPLACE]";

        internal const string CIPHERLIB_SMIME_MIME = "MIME-Version: 1.0";
        internal const string CIPHERLIB_SMIME_CONTENT_DISPOSITION = "Content-Disposition: attachment; filename=\"smime.p7m\"";
        internal const string CIPHERLIB_SMIME_CONTENT_TYPE = "Content-Type: application/x-pkcs7-mime; smime-type=enveloped-data; name=\"smime.p7m\"";
        internal const string CIPHERLIB_SMIME_CONTENT_TRANSFER_ENCODING = "Content-Transfer-Encoding: base64";

        internal const string EX_CIPHERLIB_SMIME_HEADER = "Message header caused error.";
        internal const Char SMIME_KEY_VALUE_SEPERATOR = ':';
    }
}
